package com.huayun.plugin.fastenerWeightLibrary.controller;

import com.huayun.plugin.fastenerWeightLibrary.domain.FastenerWeightLibrary;
import com.huayun.plugin.fastenerWeightLibrary.service.FastenerWeightLibraryService;
import com.huayun.plugin.materialLibrary.domain.MaterialLibrary;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

@RestController
@RequestMapping("/fastenerWeightLibrary")
public class FastenerWeightLibraryController {

    @Autowired
    private FastenerWeightLibraryService fastenerWeightLibraryService;

    public FastenerWeightLibraryController(FastenerWeightLibraryService fastenerWeightLibraryService) {
        this.fastenerWeightLibraryService = fastenerWeightLibraryService;
    }

    @PostMapping("/queryFastenerWeightLibraryList")
    public ResponseEntity<List<FastenerWeightLibrary>> queryFastenerWeightLibraryList(@RequestParam String PartNumber) {
        List<FastenerWeightLibrary> fastenerWeightLibraryList = fastenerWeightLibraryService.queryFastenerWeightLibraryByPartNumber(PartNumber);
        return ResponseEntity.ok(fastenerWeightLibraryList);
    }
    @GetMapping("/getAllFastenerWeightInfoList")
    public ResponseEntity<List<FastenerWeightLibrary>> getAllFastenerWeightInfoList() {
        List<FastenerWeightLibrary> fastenerWeightLibraryList = fastenerWeightLibraryService.getAllFastenerWeightInfoList();
        return ResponseEntity.ok(fastenerWeightLibraryList);
    }



}

